import { http } from "@/uni_modules/uview-plus";

// 登录
export const login = (data, config = {}) => {
  return http.post("/api/token", data, config);
};

// 骑手在线状态
export const riderOnlineStatus = (data) => {
  return http.post("/api/delivery/rider/sign", data, {
    custom: {
      toast: false,
      catch: true,
    },
  });
};

// 骑手个人信息
export const riderInfo = (params) => {
  return http.get("/api/delivery/rider/userinfo", {
    params,
  });
};

// 骑手申请
export const applyRider = (data) => {
  return http.post("/api/delivery/rider/apply", data);
};

// 骑手申请记录
export const applyRiderRecord = (params) => {
  return http.get("/api/delivery/rider/apply", {
    params,
  });
};

// 取消申请
export const cancelApplyRider = (data) => {
  return http.post("/api/delivery/rider/apply/cancel", data);
};

// 绑定微信
export const bindWechat = (data) => {
  return http.post("/api/wechat/bind", data);
};

// 解绑微信
export const unBindWechat = () => {
  return http.post("/api/wechat/unbind");
};

// 用户绑定的微信信息
export const bindWechatInfo = () => {
  return http.get("/api/wechat/user");
};

// 获取系统支持的银行卡类型
export const supportBankType = () => {
  return http.get("/api/back/support");
};

// 银行卡列表
export const bankCardList = (params) => {
  return http.get("/api/back/user", { params });
};

// 绑定银行卡
export const bindBankcard = (data) => {
  return http.post("/api/back/bind", data);
};

// 解绑银行卡
export const unbindBankcard = (data) => {
  return http.post("/api/back/unbind", data);
};
